<template>
<div >
<common-head></common-head>
<div v-for="(item, index) in goodsDetailList" :key="index" class="body">
    <h4>{{item.title}}</h4>
    <hr>
    <div class="goodsDesc-content" v-html=item.content></div>
</div>
 <common-footer></common-footer>
</div>
</template>
<script>
export default {
  props: ['id'],
  data () {
    return {
      goodsDetailList: []
    }
  },
  mounted () {
    console.log(111)
  },
  created () {
    console.log(this.id)
    this.getImageText(this.id)
  },
  methods: {
    // 获取图文信息
    async getImageText (id) {
      const { data: res } = await this.$http.get('/api/goods/getdesc/' + id)
      this.goodsDetailList = res.message
      console.log(res)
    }
  }
}
</script>
<style lang="less" scoped>
h4{
    font-size: 16px;
    color: #226aff;
    text-align: center;
    margin: 15px 0
}
.body{
  margin-top: 55px;
  max-width: 375px;
  overflow: hidden;
}
</style>
